# ID：罗曼罗兰 编写
# ID :VIrtualman 修改
import json
def outputarr(arr,type):
	s_arr=str(type)+":"+"["
	for i in range(len(arr)):
		s_cnt='"' +str(arr[i])+'"'
		if i!=0 :
			s_arr=s_arr+","+s_cnt
		else:
			s_arr=s_arr+s_cnt
	s_arr=s_arr+"]"
	return (s_arr)
def SendEvaluationAnsToServer(logid,isce,errorcode,ans,runtime,runmemory):
	if errorcode=='':
		errorcode=" "
	s_isce='"CE":'+str(isce)
	s_errorcode='"errorcode":'+str(errorcode)
	s_logid='"logid":'+str(logid)
	string = '{'+s_logid+','+s_isce+','+s_errorcode+','+outputarr(ans,'"ans"')+','+outputarr(runtime,'"runtime"')+','+outputarr(runmemory,'"runmemory"')+'}'
	print("返回数据："+string)
	#string=json.loads(string)
	return string
